package com.travelsky.airchina.boarding.util;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
/**
 * 文件工具类
 * @author haichenwang
 *
 */
public class FileUtil {
	/**
	 * 删除文件
	 * @param fileName 文件的绝对路径
	 */
	public static void deleteFile(String fileName){
		File file = new File(fileName);
		if(file.exists() && file.isFile()){
			file.delete();
		}
	}
	public static void appendWrite(String fileName, String content){
		FileWriter writer = null;
		try {
			writer = new FileWriter(fileName, true);
			writer.write(content);
		} catch (IOException e) {
			e.printStackTrace();
		}finally{
		    try {
				writer.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}
